.TH qutil_double_sum 3 "APRIL 2011" libqthread "libqthread"
.SH NAME
.BR qutil_double_sum ,
.BR qutil_uint_sum ,
.B qutil_int_sum
\- add up an array in parallel
.SH SYNOPSIS
.B #include <qthread.h>
.br
.B #include <qthread/qutil.h>

.I double
.br
.B qutil_double_sum
.RI "(double *" array ", size_t " length ", int " checkfeb );
.PP
.I unsigned int
.br
.B qutil_uint_sum
.RI "(unsigned int *" array ", size_t " length ", int " checkfeb );
.PP
.I int
.br
.B qutil_int_sum
.RI "(int *" array ", size_t " length ", int " checkfeb );
.SH DESCRIPTION
These functions take as input an
.I array
of
.I length
numbers and will return the sum of those numbers. This sum is computed in
parallel by using a lagging-loop structure.
.PP
If
.I checkfeb
is non-zero, these functions will wait for the entries in the array to be full
before adding them. They
.B DO NOT
check whether the array entries are properly aligned. If the datatype is too
small to do a FEB operation on,
.B they will abort,
if sanity checks are turned on.
.SH RETURN VALUE
The sum of the first
.I length
entries of
.IR array .
.SH SEE ALSO
.BR qutil_double_mult (3),
.BR qutil_double_max (3),
.BR qutil_double_min (3),
.BR qutil_uint_mult (3),
.BR qutil_uint_max (3),
.BR qutil_uint_min (3),
.BR qutil_int_mult (3),
.BR qutil_int_max (3),
.BR qutil_int_min (3),
.BR qutil_mergesort (3),
.BR qutil_qsort (3)
